#include <fstream>
#include <iostream>
#include <sstream>
#include <map>

using namespace std;

map<string, string> VID_MAP;
map<string, string> PID_MAP;

 void MapFile(const char *filename)
{
	ifstream infile(filename);	
	ostringstream tmpStream;
	char tmpLine[200];
	int c;
	string tmp;
	
	if(infile.fail())
		return;
	
	while (!infile.eof() && !infile.fail())
	{
		c = infile.get();
		if(c == '\t')
		{
			infile >> tmp;
			infile.getline(tmpLine, 200);

			tmpStream << tmpLine;
			PID_MAP[tmp] = tmpStream.str();	
			tmpStream.str("");
			continue;
		}
		infile.unget();
		infile >> tmp;		
		infile.getline(tmpLine, 200);
				
		tmpStream << tmpLine;
		VID_MAP[tmp] = tmpStream.str();	
		tmpStream.str("");
	}	
}

int main ()
{
	MapFile("usb.txt");

	//~ for example:
	cout << VID_MAP[string("08ec")] << endl;
	cout << PID_MAP[string("0998")] << endl;
	
	return 0;
}
